package simple.chat;

import java.util.List;

import com.taurus.core.entity.TObject;
import com.taurus.core.routes.ActionKey;
import com.taurus.core.routes.IController;
import com.taurus.permanent.TPServer;
import com.taurus.permanent.core.SessionManager;
import com.taurus.permanent.data.Session;

public class ChatController implements IController{
	
	@ActionKey("msg")
	public void msg(Session sender,TObject params) {
		String user = (String)sender.getSystemProperty("user");
		params.putUtfString("name", user);
		
		List<Session> list = SessionManager.me().getAllSessions();
		TPServer.me().getController().sendEvent("evt_msg", params, list);
	}
}
